﻿using System.Collections.Generic;
using Ops.Host.Core.Models;
using Ops.Host.Core.Services;

namespace Ops.Host.App.ViewModels;

public sealed class SpotCheckViewModel : SinglePagedViewModelBase<SpotCheck, SpotCheckFilter>
{
    private readonly ISpotCheckService _spotCheckService;

    public SpotCheckViewModel(ISpotCheckService spotCheckService)
    {
        _spotCheckService = spotCheckService;

        InitSearch();
    }

    public override string DownloadFileName()
    {
        return "点检信息" + base.DownloadFileName();
    }

    protected override (IEnumerable<SpotCheck> items, long pageCount) OnSearch(int pageIndex, int pageSize)
    {
        return _spotCheckService.GetPaged(QueryFilter, pageIndex, pageSize);
    }
}
